package com.zhy.learning.demo.domain2;

public abstract class D implements Study {

    public D() {
        System.out.println("D constructor");
    }

    @Override
    public String study(String name) {
        System.out.println("D study");
        beforeStudy();
        doStudy();
        return afterStudy();
    }

    public abstract void beforeStudy();

    public abstract void doStudy();

    public abstract String afterStudy();


    public static void main(String[] args) {
        D d = (D) new E();
        System.out.println(d.study(""));
    }
}
